{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
	.bg-1 {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}
 .radius:hover{
 	background:#e5e5e5;
 	border-color: #e5e5e5;
 	color: #333;
 }
 span:hover{
 	color: #333;
 }
  .line{
 	position: absolute;
		    right: 0;
		    top: 13px;
		    background: #636363;
		    width: 1px;
		    height: 14px;
		    overflow: hidden;
 }
 .radius{
 	position: relative;
 }
</style>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i>
		
		代理管理
		<span class="c-gray en">&gt;</span>
		代理列表
		<span class="c-gray en">&gt;</span>
		{if($us=='')}<a href="javascript:;">全部账号</a>{/if}
		{if($us==2)}<a href="javascript:;">内部账号</a>{/if}
		{if($us==1)}<a href="javascript:;">绑定银行卡账户</a>{/if}
		{if($us==3)}<a href="javascript:;">有提现记录账户</a>{/if}
		{if($us==5)}<a href="javascript:;">有余额账户</a>{/if}
		{if($us==6)}<a href="javascript:;">冻结账号</a>{/if}
		<a class="btn btn-success radius r"
			style="line-height: 1.6em; margin-top: 3px"
			href="javascript:location.replace(location.href);" title="刷新">
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	
	
	<div style="padding:20px;height:30px;">
  	
  	<div class="new_box">
	  <div style="height: 30px;margin-bottom: 10px;">
    <div style="float:left;height: 40px;width: 100%;background-color: #e5e5e5; border-bottom: 1px solid #e4e7e">
      
      <a style="{if($us=='')}background:#636363;border-color: #636363;color: #fff;{/if}" class="btn btn-primary radius"  href="{:url('member/us_dllist')}" >全部账号<span class="line">◆</span></a>
      <a style="{if($us==2)}background:#636363;border-color: #636363;color: #fff;{/if}" class="btn btn-primary radius"  href="{:url('member/us_dllist')}?us=2">内部账号<span class="line">◆</span></a>
      <a style="{if($us==1)}background:#636363;border-color: #636363;color: #fff;{/if}" class="btn btn-primary radius"  href="{:url('member/us_dllist')}?us=1">绑定银行卡账户<span class="line">◆</span></a>
      <a style="{if($us==3)}background:#636363;border-color: #636363;color: #fff;{/if}" class="btn btn-primary radius" href="{:url('member/us_dllist')}?us=3" >有提现记录账户<span class="line">◆</span></a>
      <a style="{if($us==5)}background:#636363;border-color: #636363;color: #fff;{/if}" class="btn btn-primary radius" href="{:url('member/us_dllist')}?us=5" >有余额账户<span class="line">◆</span></a>
      <a style="{if($us==6)}background:#636363;border-color: #636363;color: #fff;{/if}" class="btn btn-primary radius" href="{:url('member/us_dllist')}?us=6" ><span class="line">◆</span>冻结账号</a>
      <a style="" class="btn btn-primary radius" href="{:url('member/dl_neweeee')}">新增代理</a>
    </div>
  </div>
  <div style="padding-top:20px;">
    <form action="/admin/member/us_dllist?us={$us}" enctype="application/x-www-form-urlencoded" method="post" style="margin-left:20px;">
  
    <input type="text" name="ss_sql" id="ss_sql" value="{$username}"  placeholder=" 账号/ID/姓名/手机" style="width:150px" class="input-text">
     <button class="btn btn-success" type="submit" style="margin-right:20px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    注册时间从：
    <input type="text" name="sDate1" value="{$time1}" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" id="logmin" class="input-text Wdate" style="width:120px;">
     到：
    <input type="text" name="sDate2" value="{$time2}" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" id="logmax" class="input-text Wdate" style="width:120px;margin-right:15px;">
  <!--   登录时间从：
   <input type="text" onfocus="WdatePicker({minDate:$('#logmin').val()})" id="logmin" class="input-text Wdate" style="width:120px;">
    到：
    <input type="text" onfocus="WdatePicker({minDate:$('#logmax').val()})" id="logmax" class="input-text Wdate" style="width:120px;"> -->
    <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    
  </form>
  
  </div>
	<div class="page-container dataTables_wrapper">
			<div id="tab-system" class="HuiTab">
				<div class="tabCon">
					<div class="mt-20">
						<table
							class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
							<thead>
								<tr class="text-c">
									<th>ID</th>
									<th>用户名</th>
									<th>一级下级人数</th>
									<th>会员等级</th>
									<th style="width:10%">推荐码</th>
									<th>账户总额</th>
									<th>代理佣金</th>
									<th>状态</th>
									<th>注册时间</th>
									<th>登录时间</th>
									<th>团队充值总额</th>
									<th>团队提现总额</th>
									<th>团队投注总金额</th>
									<th>所属上级</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
							{volist name="query" id="item"}
								<tr class="text-c">
									<td>{$item.uid}</td>
									<td class="text-l"><a style="text-decoration:underline;{if($item.nbzh==1)}color:blue;{/if}" href="javascript:fav_alert('此等级人数详情','{:url(\'member/hierarchyDiagram\')}?yhid={$item.uid}');">{$item.username}</a></td>
									<td>{$item.xjrens}</td>
									<td>{$item.hy_name}</td>
									<td>{$item.tjm}</td>
									<td>{$item.je}</td>
									<td>{if($item.dlyj>0)} <a style="text-decoration:underline;" href="javascript:;" onclick="layer_show('{$item.username}代理佣金','/admin/statistics/commissionDateDetail?name={$item.username}')">{$item.dlyj}</a> {else/} 0 {/if}</td>
									<td>
										{if condition="$item.open eq 0"}
										 	正常
										 {elseif condition="$item.open eq 1"}
										 	冻结
										 {/if}
									</td>
									<td>{$item.reg_time|date="Y-m-d H:i:s",###}</td>
									
									<td style='text-align:center'>
										
											 {if condition="$item.login_time eq 0"}
											 【从未】
											 {else}
											 {$item.login_time|date="Y-m-d H:i:s",###}
											 {/if}
									</td>
									<td>{$item.tdczzje}</td>
									<td>{$item.tdtxzje}</td>
									<td>{$item.tdtzzje}</td>
									<td>{$item.tjr}</td>
										<td>
                        					<a href="javascript:fav_alert('投注记录','/admin/Betting/tz_list_new?ticker=1&us_sql={$item.username}&sDate1={:input('sDate1')}&sDate2={:input('sDate2')}');" >投注记录</a>
		 								<br/>
											<a href='/admin/Member/us_xxzl?user={$item.username}'>修改资料</a>
										<br/>		 
											<a onclick="if(confirm('确定注销该账户吗?')==false)return false;" href='/admin/Member/del_Dlus?uid={$item.uid}'>注销账户</a>
										<br/>
												 {if condition="$item.open eq 1"}
											<a onclick="if(confirm('确定解除冻结?')==false)return false;" href='/admin/Member/saveDLopen?uid={$item.uid}&open=0'>解冻账户</a>
												 {elseif condition="$item.open eq 0"}
											<a onclick="if(confirm('确定冻结该账户?')==false)return false;" href='/admin/Member/saveDLopen?uid={$item.uid}&open=1'>冻结账户</a>
												 {/if}
										</td>
								</tr>
								{/volist}
							</tbody>
						</table>
					</div>
				</div>
			</div>
		    <div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
		    	<div style="float:left;">  
                      每页显示<select name="limit" style="height:26px;" id="code">
                          <option value="20" {if condition="$limit eq 20"}selected{/if}>
                20
              </option>
              <option value="50" {if condition="$limit eq 50"}selected{/if}>
                50
              </option>
              <option value="100" {if condition="$limit eq 100"}selected{/if}>
                100
              </option>
                          
                       </select>条
                      </div>
		         <span style="float:right;margin-left:-2px;">总共{$query->lastPage()}页  当前第{$query->currentPage()}页 ，共{$query->total()}条</span>
		         <div style="float:left;">{$query->render()}</div>
		   </div>
	</div>


<div style="position:fixed; z-index:9999; width:300px;top:50%; height:85px; background: #ECECEC; border:#999999 solid 1px; float:left; left:40%; margin-top:-140px; display:none" id="zhixing_tuihui">
<div style=" width:300px; height:40px; line-height:40px; text-align:center; text-align:center; font-size:14px; font-family:'新宋体'">
<strong id="user_ids">加载中...</strong><br/>

<div style="float:right; margin-right:20px; font-size:12px;margin-top: -42px;"><input type="button" onclick="guanbi()" value="关闭" /></div>
</div>

<div style=" width:300px; height:30px; line-height:25px; text-align:center; text-align:center; font-size:14px; font-family:'新宋体'">
<input type="button" onclick="chaxclass('2')" value="查询提现" />
<input type="button" onclick="chaxclass('4')" value="查询登录" />
<input type="button" onclick="chaxclass('5')" value="资料详细" />
<input type="hidden" value="" id="usid" />
<input type="button"  value="推荐码" id="tuijian"/>
<input type="hidden" value="" id="tjm" />
</div>
<input type="hidden" id="us" value="{$us}">
</div>
<div style="width:400px;height:100px;border:1px solid #ccc;background:#ccc;position:fixed;top:50%;left:50%;margin-left:-200px;margin-top:-100px;display:none;" id="show" >
	<div id='qqq'>dsdsa</div>
	<div id="close" style="width:40px;height:20px;text-align: center;line-height:20px;position:absolute;top:5px;right:5px;border:1px solid #ccc;">关闭</div>
</div>

</div>
	</div>
	{/block} {block name="js"}
	<script type="text/javascript">
		$(function() {
			$('.skin-minimal input').iCheck({
				checkboxClass : 'icheckbox-blue',
				radioClass : 'iradio-blue',
				increaseArea : '20%'
			});
			$("#tab-system").Huitab({
				index : 0
			});

					});
		$('#tuijian').click(function(){
			qqq.innerHTML=''
			var tjm = document.getElementById('tjm').value;
			var arr = tjm.split('|');

			for(var i=0;i<arr.length;i++){
				
				var div=document.createElement('div')
				div.innerHTML=arr[i]
				qqq.appendChild(div)
			}

			$('#show').show()
			$('#zhenzao').hide();
	        $('#zhixing_tuihui').hide();
	        
	        
		})
		$('#close').click(function(){
        	 $('#show').hide();
        })
			function open_zhixing_1(tid){
		$.ajax({	
			 type: "POST",
        	 url: "/admin/Member/CheckingRelevantInformationDl?uid="+tid,
			 success: function(data){
			 	document.getElementById('usid').value=data[0];
			 	document.getElementById('tjm').value=data[1];
			 	$('#user_ids').html("查询【"+data[0]+"】的资料");
				
					
			}
         });
		
		$('#zhenzao').show();
		$('#zhixing_tuihui').show();
	
	 
}
function guanbi(){
		$('#zhenzao').hide();
		$('#zhixing_tuihui').hide();
	
	 
}
function fav_alert(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		area: ['90%', '90%'],
		content: url
	});
}
function chaxclass(cls){
		if(cls=="1"){
			var user=document.getElementById('usid').value;
			this.location.replace("/admin/Recharge/cz_list_ok?id=33&cid=31&us_sql="+user);
		
		}
		if(cls=="2"){
			var user=document.getElementById('usid').value;
			this.location.replace("/admin/Recharge/tx_list_ok?id=35&cid=31&us_sql="+user);
		
		}
		if(cls=="3"){
			var user=document.getElementById('usid').value;
			this.location.replace("/admin/Betting/tz_list_ok?id=47&cid=45&czid=all&us_sql="+user);
		
		}
		if(cls=="4"){
			var user=document.getElementById('usid').value;
			this.location.replace("/admin/member/jc_all?us_sql="+user);

		}
		if(cls=="5"){
			var user=document.getElementById('usid').value;
			this.location.replace("/admin/Member/us_xxzl?id=50&cid=49&user="+user);
		
		}
		if(cls=="6"){
			var user=document.getElementById('usid').value;
			this.location.replace("/admin/member/jc_all?us_sql="+user);
		
		}
}

	</script>
	<script>

$("#code").on('change',function(){
    var us=$("#us").val();
    var id = $("#code").find('option:selected').val();
    var username=$("#ss_sql").val();
    var time1=$("#logmin").val();
    var time2=$("#logmax").val();
    window.location.href="/admin/member/us_dllist?us="+us+"&limit="+id+"&ss_sql="+username+"&sDate2="+time2+"&sDate1="+time1;
  })
</script>
	  <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
	{/block}
